package com.baowenli.server;


import com.baowenli.mapper.OfficalInfoMapper;
import com.baowenli.mapper.WorkerMapper;
import com.baowenli.pojo.OrderType;
import com.baowenli.pojo.Worker;
import com.baowenli.util.SqlSessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;

public class OfficalTypeService {
    SqlSessionFactory factory = SqlSessionFactoryUtils.getSqlSessionFactory();

    /**
     * 查询所有
     *
     * @return
     */
    public List<OrderType> selectAllOfficalInfo() {
        //2.获取sqlSession
        SqlSession sqlSession = factory.openSession();
        //3.获取BrandMapper
        OfficalInfoMapper mapper = sqlSession.getMapper(OfficalInfoMapper.class);
        //4.调用方法
        List<OrderType> orderTypes = mapper.selectAllInfo();
        sqlSession.commit();
        sqlSession.close();
        return orderTypes;
    }


}
